<?php
class Gyujtotipus extends AppModel {

	var $name = 'Gyujtotipus';
	/*var $validate = array(
		'nev' => array('custom','/[a-z0-9íéáűőúöüó]/i')
	);*/

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $hasMany = array(
			'Gyujto' => array('className' => 'Gyujto',
								'foreignKey' => 'gyujtotipus_id',
								'dependent' => false,
								'conditions' => '',
								'fields' => '',
								'order' => '',
								'limit' => '',
								'offset' => '',
								'exclusive' => '',
								'finderQuery' => '',
								'counterQuery' => ''
			)
	);

	public function getGyujtokByTipus($gyujtotipusId){
		$this->unbindModel(array('hasMany' => array('Gyujto')));
		$this->bindModel(array('hasMany' => array('Gyujto' => array('order' => 'kod'))));
		$gyujtok = $this->find('all',
								array(
								 'conditions' => array('id' => $gyujtotipusId)
									)
								);
		return $gyujtok;
	}

}
?>